#include <iostream>

using namespace std;

#include "DataStream.h"
#include "Serializable.h"

using namespace utility::serialize;


class A :public Serializable
{
public:
	A(){}
	A(const string & name, int age,const string &gender): m_name(name), m_age(age),m_gender(gender){}
	~A(){}

	void show()
	{
		std::cout << m_name << ',' << m_age << "," << m_gender << std::endl;
	}

	SERIALIZE(m_name, m_age, m_gender)

private:
	string m_name;
	int m_age;
	string m_gender;
};

int main()
{
	int a = 123;
	DataStream ds;
	ds << a;
	int b;
	ds >> b;
	std::cout << b << std::endl;

	//A a("kitty", 18, "male");
	//DataStream ds;
	//ds << a;
	//a.show();

	//A b;
	//ds >> b;
	//b.show();


	//DataStream ds;
	//ds << 123 << 1.23 << true << "kitty";
	//int a;
	//double b;
	//bool c;
	//std::string s;

	//ds >> a >> b >> c >> s;
	//std::cout << a << ',' << b << ','<< c<< ',' << s << std::endl;

	//std::vector<int> v{ 1,2,3 };
	//ds.write(v);

	//std::vector<int> v2;
	//ds.read(v2);

	//for (auto it = v2.begin(); it != v2.end(); it++)
	//{
	//	std::cout << *it << std::endl;
	//}
	
	//std::map<string, int> m;
	//m["a"] = 1;
	//m["b"] = 2;
	//m["c"] = 3;

	//ds.write(m);

	//std::map<string, int> m2;

	//ds>>m2;

	//for (auto it = m2.begin(); it != m2.end(); it++)
	//{
	//	std::cout << it->first << "=" << it->second << std::endl;
	//}


	return 0;
}